package cn.edu.ctbu.firstdata.controller;


import cn.edu.ctbu.firstdata.domain.Student;
import cn.edu.ctbu.firstdata.service.IStudentService;
import cn.edu.ctbu.firstdata.service.Impl.StudentServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//@RestController
//@Slf4j
//public class StudentController {
//    @Autowired
//    private StudentServiceImp studentServiceImp;
//
////    private final Logger logger = LoggerFactory.getLogger(StudentController.class);
//
//    @RequestMapping(value = "sayhi",method = RequestMethod.GET)
//    public List<Student> showAll(){
////        logger.error("你访问了sayhi url");
//        log.info("访问了我的url");
//        return studentServiceImp.getall();
//    }
//}
@Controller
@RequestMapping("/student")
public class StudentController {

    @GetMapping("list")
    public  String list(){
        return "student/list";
    }

    @GetMapping("add")
    public  String add(){
        return "student/add";
    }

    @GetMapping("edit/{id}")
    public  String edit(@PathVariable Integer id){
        return "student/edit";
    }
}